import request from '@/utils/request'

// 根据设备获取异常信息
export function abnormal(abnormalId) {
    return request({
        url: '/inspection/abnormal/' + abnormalId,
        method: 'get',
    })
}

// 修复异常
export function fixAbnormal(data) {
    return request({
        url: '/inspection/abnormal',
        method: 'put',
        data
    })
}

// 获取巡检异常工单列表
export function listWorkOrderAbnormal(params) {
    return request({
        url: '/inspection/abnormal/listWorkOrderAbnormal',
        method: 'get',
        params
    })
}

//异常列表
export function abnormalList(params) {
    return request({
        url: "/inspection/abnormal/list",
        method: "get",
        params,
        isCancel: true
    })
}

//未解决异常统计查询
export function abnormalCount() {
    return request({
        url: "/inspection/abnormal/count",
        method: "get",
    })
}

// 批量关联报修工单
export function batchRelevancy(data) {
  return request({
    url: '/inspection/abnormal/batchRelevancy',
    method: 'put',
    data: data
  })
}

//工程师-异常列表
export function abnormalMyTodoList(params) {
    return request({
        url: "/inspection/abnormal/myTodoList",
        method: "get",
        params,
        isCancel: true
    })
}
